<!--
 * @Date: 2023-02-20 14:57:32
 * @LastEditTime: 2023-03-06 14:31:11
 * @FilePath: /xing-qiu-da-zhan/src/components/common/ClistState/ClistState.vue
 * 介绍:
-->
<script lang="ts" setup>
import type { StateType } from "@@/hooks/usePagingRequest";
const props = defineProps<{
  type?: StateType;
  message?: string;
}>();
</script>

<template>
  <div class="ClistState">
    <template v-if="props.type == 'null'">
      <van-empty
        class="ClistState__null"
        :description="props.message || $t(`mei-you-gen-duo-shu-ju-le`)"
      />
    </template>
    <template v-else-if="props.type == 'err'">
      <van-empty
        class="ClistState__error"
        image="error"
        :description="props.message || 'request error'"
      />
    </template>
    <template v-else-if="props.type == `end`">
      <span class="ClistState__end">{{
        props.message || $t(`mei-you-gen-duo-shu-ju-le`)
      }}</span>
    </template>
  </div>
</template>

<style lang="less" scoped>
.ClistState__null {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}
.ClistState__error {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}
.ClistState__end {
  color: #aaa;
}
</style>
